<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
</head>
<body>
  <div class="wrap">
    <!-- 游戏 -->
    <div class="game-page">
    <div class="video-list-wrap" id="liveList">
      <ul class="clearfix" id="div_list">列表
      </ul>
    </div>

    </div>
  </div>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/common.js" ></script>
<script type="text/javascript">

  apiready = function(){
    getList();
    api.setRefreshHeaderInfo({
       // loadingImg: 'widget://image/refresh.png',
        bgColor: '#ccc',
        textColor: '#fff',
        textDown: '下拉刷新...',
        textUp: '松开刷新...'
    }, function(ret, err) {
        //在这里从服务器加载数据，加载完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
        getList();api.refreshHeaderLoadDone();
    });
  }

  function getList(){
    var html='';
    var div_list = cachelist();
    if(div_list){
        api.showProgress({
            title: '加载中...',
            modal: false
        });
        for(var i in div_list){
            var item = div_list[i];
            html +='<li onclick="openWin(\''+item.url+'\')">'+
            '<div class="til">'+item.title+'</div>'+
            '<div class="detail clearfix">'+item.url+'</div></li>';
        }
        api.hideProgress();
    }
    var obj = $api.byId('div_list');
    if(!html && html==''){
       html  ='<li><div class="til">暂无浏览历史</div></li>';
    }
    $api.html(obj,html);
  }
    //打开播放页
  function openWin(url){
      api.showProgress({
          title: '加载中...',
          modal: false
      });
      setTimeout(function(){api.hideProgress();},1000);
      var delay = 0;
      if(api.systemType != 'ios'){
          delay = 300;
      }
      api.openWin({
          name: 'jiexi_win',
          url: './jiexi_win.html',
          delay: 800,
          pageParam:{url:url},
          bgColor: 'rgba(0,0,0,0)'
      });
  }  
</script>
</html>
